{include file="common/business2/header" /}

        <div class="hide">
            <div name="top_bar" class="pull-left" style="display: none;">
                <a name="href" style="color: #676a6c;" href="__WWW_STATIC__/dashboard">
                    <div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m">
                        首 页
                    </div>
                </a>
            </div>
            <div name="top_bar" class="pull-left dropdown">
                <div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m dropdown-toggle" data-toggle="dropdown">
                    店 铺 <b class="caret"></b>
                </div>
                <ul class="dropdown-menu m-t-xs animated flipInY" style="transform-origin:0 0;-webkit-transform-origin:0 0;-webkit-animation-duration: 0.5s;animation-duration: 0.5s;">
                    <li><a name="href" href="__WWW_STATIC__/shops">自提点</a></li>
                    <li><a name="href" href="__WWW_STATIC__/files">我的文件</a></li>
                </ul>
            </div>
            <div name="top_bar" class="pull-left dropdown">
                <div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m dropdown-toggle" data-toggle="dropdown">
                    商 品 <b class="caret"></b>
                </div>
                <ul class="dropdown-menu m-t-xs animated flipInY" style="transform-origin:0 0;-webkit-transform-origin:0 0;-webkit-animation-duration: 0.5s;animation-duration: 0.5s;">
                    <li><a name="href" href="__WWW_STATIC__/product">所有商品</a></li>
                    <li><a name="href" href="__WWW_STATIC__/product/template">商品详情模板</a></li>
                    <li><a name="href" href="__WWW_STATIC__/product/rent_rule">租赁规则模板</a></li>
                    <li><a name="href" href="__WWW_STATIC__/product/group">商品分类</a></li>
                    <li><a name="href" href="__WWW_STATIC__/product/freight_template">运费模板</a></li>
                    <li><a name="href" href="__WWW_STATIC__/product/giveback">归还地址</a></li>
                </ul>
            </div>
            <div name="top_bar" class="pull-left dropdown" style="display: none;">
                <div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m dropdown-toggle" data-toggle="dropdown">
                    订 单 <b class="caret"></b>
                </div>
                <ul class="dropdown-menu m-t-xs animated flipInY" style="transform-origin:0 0;-webkit-transform-origin:0 0;-webkit-animation-duration: 0.5s;animation-duration: 0.5s;">
                    <li><a name="href" href="__WWW_STATIC__/orders">所有订单</a></li>
                    <li><a name="href" href="__WWW_STATIC__/orders/pick_up_self">到店自提订单</a></li>
                    <li><a name="href" href="__WWW_STATIC__/orders/shop_delivery">门店配送订单</a></li>
                    <li><a name="href" href="__WWW_STATIC__/orders/safeguard_rights">维权订单</a></li>
                    <li><a name="href" href="__WWW_STATIC__/orders/comments">评论列表</a></li>
                    <li><a name="href" href="__WWW_STATIC__/orders/income_raise">收入/提现</a></li>
                </ul>
            </div>
            <div name="top_bar" class="pull-left">
                <a name="href" style="color: #676a6c;" href="__WWW_STATIC__/market"><div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m dropdown-toggle">
                    优惠券
                    </div>
                </a>
            </div>
            <div name="top_bar" class="pull-left dropdown" style="display: none;">
                <div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m dropdown-toggle" data-toggle="dropdown">
                    营 销 <b class="caret"></b>
                </div>
                <ul class="dropdown-menu m-t-xs animated flipInY" style="transform-origin:0 0;-webkit-transform-origin:0 0;-webkit-animation-duration: 0.5s;animation-duration: 0.5s;">
                    <li><a name="href" href="__WWW_STATIC__/market">优惠券</a></li>
                    <li><a name="href" href="__WWW_STATIC__/market/full_reduce">满减/送</a></li>
                    <li><a name="href" href="__WWW_STATIC__/market/spell_group">拼团</a></li>
                    <li><a name="href" href="__WWW_STATIC__/dashboard}">月卡</a></li>
                </ul>
            </div>
            <div name="top_bar" class="pull-left dropdown" style="display: none;">
                <div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m dropdown-toggle" data-toggle="dropdown">
                    统 计 <b class="caret"></b>
                </div>
                <ul class="dropdown-menu m-t-xs animated flipInY" style="transform-origin:0 0;-webkit-transform-origin:0 0;-webkit-animation-duration: 0.5s;animation-duration: 0.5s;">
                    <li><a class="disabled" name="href" href="__WWW_STATIC__/statistics/user">用户统计</a></li>
                    <li><a name="href" href="__WWW_STATIC__/statistics/flow">流量统计</a></li>
                    <li><a name="href" href="__WWW_STATIC__/statistics/product">商品统计</a></li>
                    <li><a name="href" href="__WWW_STATIC__/statistics/trade">交易统计</a></li>
                </ul>
            </div>

            <div name="top_bar" class="pull-left">
                <a name="href" style="color: #676a6c;" href="__WWW_STATIC__/rules">
                    <div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m">
                        规则中心
                    </div>
                </a>
            </div>

            <div name="top_bar" class="pull-left">
                <a name="href" style="color: #676a6c;" href="__WWW_STATIC__/message"><div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m dropdown-toggle">
                    消息中心
                    <span class="badge badge-danger" style="background-color: #ed5565; color: #ffffff;"></span>
                    </div>
                </a>
            </div>

            <div name="top_bar" class="pull-left dropdown">
                <div style="height:60px;border-radius:0px;line-height:48px;" class="btn btn-w-m dropdown-toggle" data-toggle="dropdown">
                    权限设置  <b class="caret"></b>
                </div>
                <ul class="dropdown-menu m-t-xs animated flipInY" style="transform-origin:0 0;-webkit-transform-origin:0 0;-webkit-animation-duration: 0.5s;animation-duration: 0.5s;">
                    <li><a name="href" href="__WWW_STATIC__/admin">管理员</a></li>
                    <li><a name="href" href="__WWW_STATIC__/admin/role">角色</a></li>
                </ul>
            </div>

            <div class="dropdown pull-right" style="padding-top:10px;margin-right:20px;">
                <span class="pull-right" style="padding-left:15px;">
                    <img alt="image" class="img-circle" src="__WWW_STATIC__/www/index/img/avatar.png" width="40" height="40">
                    <!-- //asset('official/avatar.png') -->
                </span>
                <a data-toggle="dropdown" class="dropdown-toggle pull-left" href="javascript:void(0)">
                    <span class="clear text-right">
                        <span class="block m-t-xs" style="font-size:14px;margin-top:2px;">
                            <strong id="name" class="font-bold"></strong>
                        </span>
                        <span class="text-muted text-xs block" style="font-size:12px;">
                            <b id="role" class="caret"></b>
                        </span>
                    </span>
                </a>
                <ul class="dropdown-menu m-t-xs animated flipInX" style="margin-top:0px;transform-origin:0 0;-webkit-transform-origin:0 0;">
                    <li><a href="__WWW_STATIC__/admin/modify_self">修改资料</a></li>
                    <li class="divider"></li>
                    <li><a href="javascript:void(0)" id="logout">注销</a></li>
                </ul>
            </div>
            <div id="consult_btn" style="float: right; margin-right: 30px; margin-top: 10px; display: none;">
                <div id="consult" style="background-image: url(__WWW_STATIC__/img/consult.png); height: 40px; width: 120px; cursor: pointer; background-size: 100%;"></div>
            </div>
        </div>
    </nav>

</div>

        <div class="wrapper wrapper-content gray-bg auto_center" style="margin-top:20px !important;padding-top:0px;padding-bottom:0px;">

            <div class="row" style="padding: 40px;">
                <div class="col-lg-7 col-md-7 col-xs-7">
                    <div style="background-image: url(__WWW_STATIC__/www/index/img/shangjiazhongxin.jpg); height: 460px; background-size: 100%;"></div>
                </div>
                <div class="col-lg-5 col-md-5 col-xs-5">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title" style="height: auto; text-align: center;">
                            <h2>忘记密码</h2>
                        </div>
                        <div class="ibox-content">
                            <form class="form-horizontal">
                            {:token()}
                                <div class="form-group" style="margin-top: 20px;">
                                    <span class="col-lg-3 col-md-3 col-xs-3 control-label">手机号</span>
                                    <div class="col-lg-9 col-md-9 col-xs-9">
									<input id="tel" type="tel" placeholder="请输入手机号"  value=""  class="form-control" autocomplete="off"></div>
                                </div>
                                <div class="form-group">
                                    <span class="col-lg-3 col-md-3 col-xs-3 control-label">手机验证码</span>
                                    <div class="col-lg-9 col-md-9 col-xs-9">
                                        <div class="col-lg-12 col-md-12 col-xs-12 no-padding">
                                            <div class="col-lg-7 col-md-7 col-xs-7 no-padding">
                                                <input type="text" class="form-control" value=""  id="verify_code" autocomplete="off">
                                            </div>
                                            <div class="col-lg-5 col-md-5 col-xs-5" style="padding: 0;position:relative;">
                                                <input id="btnSendCode" type="button" value="获取验证码" onClick="sendMessage()" style="width: 100px;height: 33px;color: #fff;background:#43b9ec;border:none;" />
                                            </div>
                                        </div>
                                        <span class="help-block m-b-none hide verify_code_error danger_red">手机验证码输入错误</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <span class="col-lg-3 col-md-3 col-xs-3 control-label">新密码</span>
                                    <div class="col-lg-9 col-md-9 col-xs-9">
                                        <input placeholder="请输入新密码" type="password" value="" class="form-control" id="new_pw" autocomplete="off">
										
                                        <!-- <span class="help-block m-b-none hide verify_code_error danger_red">手机验证码输入错误</span> -->
                                    </div>
                                </div>
                                <div class="form-group" style="margin-top: 40px;">
                                    <div class="col-lg-12 col-md-12 col-xs-12">
                                        <button id="forgetBtn" class="btn btn-success" type="button" style="width: 100%;">确定</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
{include file="common/business2/footer" /}
</div>
<script>
	
</script>


<script src="__WWW_STATIC__/www/index/js/bootstrap.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.metisMenu.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.slimscroll.min.js"></script>

<script src="__WWW_STATIC__/www/index/js/momentjs.js"></script>

<!-- Flot -->
<script src="__WWW_STATIC__/www/index/js/jquery.flot.js"></script>
<!-- <script src="__WWW_STATIC__/js/jquery.flot.tooltip.min.js"></script> -->
<script src="__WWW_STATIC__/www/index/js/jquery.flot.resize.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.flot.pie.js"></script>

<!-- Data Tables -->
<script src="__WWW_STATIC__/www/index/js/jquery.dataTables.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/dataTables.bootstrap.js"></script>
<script src="__WWW_STATIC__/www/index/js/dataTables.responsive.js"></script>

<script src="__WWW_STATIC__/www/index/js/jquery.twbsPagination.min.js"></script>

<!-- Chosen -->
<script src="__WWW_STATIC__/www/index/js/select2.full.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/zh-CN.js"></script>
<!-- Data picker -->
<script src="__WWW_STATIC__/www/index/js/daterangepicker.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootstrap-datetimepicker.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootstrap-datetimepicker.zh-CN.js"></script>

<!-- Nestable List -->
<!-- <script src="__WWW_STATIC__/js/plugins/nestable/jquery.nestable.js"></script> -->

<!-- Custom and plugin javascript -->
<script src="__WWW_STATIC__/www/index/js/inspinia.js"></script>
<script src="__WWW_STATIC__/www/index/js/pace.min.js"></script>

<!-- ChartJS-->
<script src="__WWW_STATIC__/www/index/js/Chart.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/chartjs-demo.js"></script>

<script src="__WWW_STATIC__/www/index/js/icheck.min.js"></script>

<script src="__WWW_STATIC__/www/index/js/art-template.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.md5.js"></script>
<script src="__WWW_STATIC__/www/index/js/bootbox.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/notify.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/laravel-sms.js"></script>

<script src="__WWW_STATIC__/www/index/js/ZeroClipboard.min.js"></script>
<script src="__WWW_STATIC__/www/index/js/jquery.gridly.js"></script>
<script type="text/javascript">
var InterValObj; //timer变量，控制时间
var count = 60; //间隔函数，1秒执行
var curCount;//当前剩余秒数
var code = ""; //验证码
var codeLength = 6;//验证码长度
function sendMessage() {
curCount = count;
var $phone = $("#tel").val();
//产生验证码
for (var i = 0; i < codeLength; i++) {
    code += parseInt(Math.random() * 9).toString();
}
//设置button效果，开始计时
    $("#btnSendCode").attr("disabled", "true");
    $("#btnSendCode").val( + curCount + "秒后再获取");
    InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次
//向后台发送处理数据
    $.ajax({
        type: "POST", 
        dataType: "json", 
        url: "{:url('merchant/sendMessage', '', false)}/phone/" + $phone, 
        error: function (XMLHttpRequest, textStatus, errorThrown) { },
        success: function (msg){ }
    });
}
//timer处理函数
function SetRemainTime() {
    if (curCount == 0) {                
        window.clearInterval(InterValObj);//停止计时器
        $("#btnSendCode").removeAttr("disabled");//启用按钮
        $("#btnSendCode").val("重新发送验证码");
        code = ""; //清除验证码。如果不清除，过时间后，输入收到的验证码依然有效    
    }
    else {
        curCount--;
        $("#btnSendCode").val( + curCount + "秒后再获取");
    }
}
</script>
<script>

    var fakeId = new Date().getTime();

    function getFakeId()
    {
        fakeId++;
        return fakeId;
    }

    var path = "__WWW_STATIC__";
    function url(str)
    {
        return path + "/" + str;
    }

    var languageSetting = {
        "sProcessing": "处理中...",
        "sLengthMenu": "显示 _MENU_ 项结果",
        "sZeroRecords": "没有匹配结果",
        "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
        "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
        "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
        "sInfoPostFix": "",
        "sSearch": "搜索: ",
        "sUrl": "",
        "sEmptyTable": "表中数据为空",
        "sLoadingRecords": "载入中...",
        "sInfoThousands": ",",
        "oPaginate": {
            "sFirst": "首页",
            "sPrevious": "上页",
            "sNext": "下页",
            "sLast": "末页"
        },
        "oAria": {
            "sSortAscending": ": 以升序排列此列",
            "sSortDescending": ": 以降序排列此列"
        }
    };

    var dateOptions = {
        format: "yyyy-mm-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
        language: "zh-CN"
    };

    var docHeight = $("body").height();
    var winHeight = $(window).height();
    if(docHeight < winHeight){
        $("#page-wrapper").css("min-height", winHeight - 40);
    }
    $(".footer").removeClass("hide");

    function showAlert(message, callback){
        bootbox.alert({
            message: message,
            size: 'small',
            backdrop: true,
            buttons: {
                ok: {
                    label: '确定',
                    className: 'btn-success'
                }
            },
            callback: callback
        });
    }

    function showAlertWithCall(message, callback){
        bootbox.alert({
            message: message,
            size: 'small',
            backdrop: true,
            buttons: {
                ok: {
                    label: '确定',
                    className: 'btn-success'
                }
            },
            callback: function(){
                callback();
            }
        });
    }

    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }

    toastr.options = {
        "closeButton": false,
        "debug": false,
        "newestOnTop": false,
        "progressBar": false,
        "positionClass": "toast-top-center",
        "preventDuplicates": false,
        "onclick": null,
        "showDuration": "500",
        "hideDuration": "10",
        "timeOut": "3000",
        "extendedTimeOut": "10",
        "showEasing": "linear",
        "hideEasing": "linear",
        "showMethod": "slideDown",
        "hideMethod": "slideUp"
    };

    function notify(content, type)
    {
        toastr.remove();
        switch(type){
            case "error":
                toastr.error(content);
                break;
            default:
                toastr.error(content);
                break;
        }
    }

    function showConfirm(message, next){
        bootbox.confirm({
            message: message,
            size: 'small',
            backdrop: true,
            buttons: {
                confirm: {
                    label: '确定',
                    className: 'btn-white'
                },
                cancel: {
                    label: "取消",
                    className: "btn-success"
                }
            },
            callback: function(result) {
                next(result);
            }
        });
    }

    function showConfirmWithOver(message, next){
        bootbox.confirm({
            message: message,
            size: 'small',
            backdrop: true,
            buttons: {
                confirm: {
                    label: '确定',
                    className: 'btn-success'
                },
                cancel: {
                    label: "取消",
                    className: "btn-white"
                }
            },
            callback: function(result) {
                next(result);
            }
        });
    }

    $("input[type=number]").on("keyup keydown keypress input", function(){
        var val = $(this).val();
        if( !IsNum(val) ){
            $(this).val(1);
            notify("请输入数字");
        }
    });

    function IsNum(s)
    {
        if(s!=null){
            var r,re;
            re = /\d*/i;
            r = s.match(re);
            return (r==s)?true:false;
        }
        return false;
    }

    $("#logout").on("click", function(){
        $.post(url("logout"), {}, function(data){
            window.location.href = url("login");
        });
    });

    var hre = window.location.href
    if( hre == url("regist/shop_info") || hre == url("regist/qyzz") || hre == url("regist/brand_info") || hre == url("regist/result")  ){
        $("div[name=top_bar]").css("display", "none");
        $("#consult_btn").css("display", "block");
    }

    $("#consult_btn").click(function(){
        $("#zhichiBtnBox").trigger("click");
    });

    $("input[type=tel]").attr("autocomplete", "off");
    $("input[type=password]").attr("autocomplete", "off");
    $("input[type=text]").attr("autocomplete", "off");
    if( !localStorage.getItem("first") ){
        $("#first_suggest").css("display", "block");
    }
    $("#cancel_first_suggest").click(function(){
        $("#first_suggest").css("display", "none");
        localStorage.setItem("first", true);
    });
</script>
<script>
    // window.addEventListener("keydown", function(e){
    //     if(e.keyCode == 13){
    //         doForget();
    //     }
    // });

    var rules = {
        "telephone": /^1((3[0-9]|4[57]|5[0-35-9]|7[0678]|8[0-9])\d{8}$)/,
        "password": /[\w\d]{8,}/,
    };

    $("#forgetBtn").on("click", doForget);
    // $("#captcha").on("click", refreshCaptcha);

    function doForget(){
        var tel = $("#tel").val().trim();
        var pw = $("#new_pw").val().trim();
        var code = $("#verify_code").val().trim();
        if(tel == ""){
            layer.msg("请输入手机号");
            return;
        }
        if(tel.length != 11 || tel[0] != '1'){
            layer.msg("请输入正确手机号");
            return;
        }
        if(pw == ""){
            layer.msg("请输入新密码");
            return;
        }
        if(code == ""){
            layer.msg("输入验证码错误");
            return;
        }
// alert(pw);
        $.post("{:url('merchant/updatePwd')}", {
            /*"code": code,*/
            "tel": tel,
            "pw":pw,
            "code" : code
        }, function(data){
            if(data.status==1){
                setTimeout(function(){
                     layer.msg(data.msg);  
                     window.location.href = "{:url('merchant/login')}"; 
                },1000);
                // alert(data.msg);
                // window.location.href = "{:url('merchant/login')}";
            }else{
                layer.msg(data.msg);
                // notify(data["err_msg"], "error");
                // refreshCaptcha();
            }
        });
    }

    $("#btn_cover").on("click", function(){
        if(!rules["telephone"].test($("#tel").val())){
            $(".tel_error").removeClass("hide");
            notify("手机号码输入错误");
        }else{
            $(".tel_error").addClass("hide");
            $("#verify_modal").modal("show");
            $("#code").val("");
        }
    });
 // alert(pw);
    $("#comfirm_btn").click(function(){
        var code = $("#code").val();
        if(code.length != 5){
            hasError = true;
            $(".code_error").removeClass("hide");
        }else{
            $(".code_error").addClass("hide");
            $.post(url("check_verify_code"), {code: code}, function(data){
                if(data.success){
                    $("#verify_modal").modal("hide");
                    $(".tel_error").addClass("hide");
                    $("#send_verify_code").click();
                }else{
                    notify(data.err_msg);
                    refreshCaptcha();
                }
            });
        }
    });

    $("#send_verify_code").sms({
        interval: 60,
        requestData: {
            mobile: function(){
                return $("#tel").val();
            },
            code: function(){
                return $("#code").val();
            }
        }
    });

    $("#captcha").on("click", refreshCaptcha);

function refreshCaptcha()
{
    $("#captcha img").attr("src", url("captcha" + "?t=" + moment().unix()));
}

</script><div class="modal inmodal fade" id="verify_modal" tabindex="-1" role="dialog" aria-hidden="false" style="display: none;"><div class="modal-backdrop fade"></div>
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label class="col-lg-3 col-md-3 col-xs-3 control-label">验证码</label>
                    <div class="col-lg-9 col-md-9 col-xs-9">
                        <input type="text" class="form-control" style="width:150px;" id="code">
                        <div class="col-lg-12 col-md-12 col-xs-12 no-padding" style="cursor:pointer;" id="captcha">
                            <img src="" width="150" height="40" style="border: 1px solid #e5e6e7;margin-top:10px;margin-bottom: 10px;"> <a href="javascript:void(0);">换一张</a>
                        </div>
                        <span class="help-block m-b-none danger_red code_error hide">验证码输入错误</span>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal" id="cancelBtn">取消</button>
                <button type="button" class="btn btn-success btn-md" id="comfirm_btn">确定</button>
            </div>
        </div>
    </div>
</div>
<script>
function getCookie(name)
{
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
$(document).ready(function(){
   $("#verify_code").val("");
   $("#new_pw").val("");
    var arr =getCookie('phone');
 
   if(arr!=null||arr!="") 
   {
   $("#tel").val(arr);
   }
  
});
</script>





</body></html>